package com.tjsinfo.tjsoa.system.action;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.json.JSONArray;

import com.tjsinfo.tjsoa.system.bo.IOATreeBO;

import org.apache.struts.actions.DispatchAction;


public class SelectUserTreeAction   extends  DispatchAction{
	
    private IOATreeBO oaTreeBo;

	public IOATreeBO getOaTreeBo() {
		return oaTreeBo;
	}

	public void setOaTreeBo(IOATreeBO oaTreeBo) {
		this.oaTreeBo = oaTreeBo;
	}

	public ActionForward getuserradio(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
					throws Exception {
	
		try {
			JSONArray array = new JSONArray();
				array =  oaTreeBo.selectSystemDepartmentRadio();
				response.getWriter().print(array);
			return null;
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
	
	public ActionForward getusercheck(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
					throws Exception {
	
		try {
			JSONArray array = new JSONArray();
				array =  oaTreeBo.selectSystemDepartment();
				response.getWriter().print(array);
			return null;
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
}
